<extend name="Public/base"/>
<block name="style">
    <link type="text/css" rel="stylesheet" href="__STATIC__/Cms/Static/css/posts.css"/>
</block>

<block name="body">
    <div class="row">
    <form id="form_id" method="post" action="{$form_url}" class="form-postadd">
        <div class="col-md-8 pr">
        <div class="panel panel-info">
            <div class="panel-heading">
                  <h3 class="panel-title">{$meta_title}</h3>
            </div>
             <div class="panel-body">
                <input type="hidden" name="id" value="{$posta.id}" />
                    <div class="form-group ud-title w label-floating">
                      <label class="control-label" for="focusedInput1">标题</label>
                      <input class="form-control" name="title" value="{$posta.title}" type="text">
                    </div>
                 
                    <!--编辑器-->
                    <div class="form-group w">
                    {:W('Common/Ueditor/editor',array('content','content',$posta['content'],'100%','300px','all'))}
                    </div>
                    <!--编辑器-->
                    <div class="ud-page-d">
                        <div class="ud-page-d_d">
                            <input id="ud-field" class="zhuijia validate[required] form-control" name="fields" type="text" placeholder="字段" /><p class="ud-jia">+</p>
                        </div>
                        <div class="chip ud-friendlink white_ud"> test1
                            <i class="material-icons iconfont">&#xe610;</i>
                        </div>
                        <div class="chip ud-friendlink white_ud"> test2
                            <i class="material-icons iconfont">&#xe610;</i>
                        </div>
                        <div class="chip ud-friendlink white_ud jia"> test3 
                            <i class="material-icons iconfont">&#xe610;</i>
                        </div>
                    </div>

                <div class="ud-change-k tc mt-30">
                    <button class="radius ud-button bg-color-blue ajax-post ud-shadow" id="login" align="center" type="submit" target-form="form-postadd">发布</button>
                </div>
        </div>

        </div>
    </div>

    <div class="col-md-4">
        <div class="panel panel-info">
        <div class="panel-heading">
              <h3 class="panel-title">选项面板</h3>
        </div>
         <div class="panel-body">
            <div>缩略图</div>
            <div class="ud-photo oh">{:W('Common/UploadImage/render',array(array('id'=>'img','class'=>'uploadsingleimg','name'=>'img','value'=>$posta['img'])))}</div>
            <div>发布时间</div>
            <div class="ud-time">
                <label for="date_d">选择日期：</label>
                <input id="date_d" class="form-control form-datetime" type="text" value="{$Think.NOW_TIME|date="Y-m-d H:i",###}" name="create_time" readonly>

            </div>
            <div>审核状态</div>
            <div class="ud-status">
                <div class="radio radio-primary">
                    <label for="status1"><input type="radio" name="status" id="status1" value="1" checked />已发布</label>
                </div>
                <div class="radio radio-primary">
                    <label for="status2"><input type="radio" name="status" id="status2" value="3" />待审核</label>
                </div>
                <div class="radio radio-primary">
                    <label for="status3"><input type="radio" name="status" id="status3" value="0" />草稿</label>
                </div>

            </div>
            <div>分类</div>
            <div class="radio radio-primary">
                <volist name="post_category" id="category">
                    <label for="category{$i}">
                        <input type="radio" id="category{$i}"  name="category_id" value="{$category.term_id}" <eq name="category.term_id" value="$category_id">checked</eq>/>
                        {$category.name}
                     </label>
                </volist>
            </div>
            <div>标签</div>
            <div class="ud-page-k">
                <div class="checkbox">
                    <volist name="post_tags" id="tag">
                       <label>
                          <input type="checkbox">{$tag.name}
                        </label>
                    </volist>
                    
                  </div>
                
            </div>
            </div>
        </div>
    </div>
    </div>
    </form>
</block>

<block name="script">
        <link href="__PUBLIC__/lib/datetimepicker/datetimepicker.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="__PUBLIC__/lib/datetimepicker/datetimepicker.min.js"></script>

        <script>
            $('.form-datetime').datetimepicker({
                language: "zh-CN",
                autoclose: true,
                format: 'yyyy-mm-dd hh:ii'
            });
            $('.form-date').datetimepicker({
                language: "zh-CN",
                minView: 2,
                autoclose: true,
                format: 'yyyy-mm-dd'
            });
            $('.form-time').datetimepicker({
                language: "zh-CN",
                minView: 0,
                startView:1,
                autoclose: true,
                format: 'hh:ii'
            });
            $('.time').change(function () {
                var fieldName = $(this).attr('data-field-name');
                var dateString = $(this).val();
                var date = new Date(dateString);
                var timestamp = date.getTime();
                $('[name=' + fieldName + ']').val(Math.floor(timestamp / 1000));
            });
        </script>
</block>